package wens.pig.base.plugin.form;

import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.context.RequestContext;
import kd.bos.form.field.BasedataEdit;

import java.util.EventObject;

import static wens.pig.base.common.consts.mm.PrescriptionInfoConstant.ORG;

public class FarmOrgEditPlugin  extends AbstractBillPlugIn {

    /**
     * 设置默认组织
     *
     * @param e
     */
    @Override
    public void afterCreateNewData(EventObject e) {
        BasedataEdit org = this.getControl("wens_org");
        if(null == org){
            this.getModel().setValue(ORG, RequestContext.get().getOrgId());
        }else {
            this.getModel().setValue("wens_org", RequestContext.get().getOrgId());
        }
    }

}
